using System.ComponentModel.DataAnnotations;

namespace FServer.Core.Entities;

public class Player
{
    public Guid Id { get; set; }
    
    public Guid UserId { get; set; }
    
    public User User { get; set; } = null!;
    
    [Required]
    [MaxLength(50)]
    public string Nickname { get; set; } = string.Empty;
    
    [MaxLength(500)]
    public string? AvatarUrl { get; set; }
    
    public int Level { get; set; } = 1;
    
    public long Experience { get; set; } = 0;
    
    public long Gold { get; set; } = 0;
    
    public int Diamonds { get; set; } = 0;
    
    public int Energy { get; set; } = 100;
    
    public int MaxEnergy { get; set; } = 100;
    
    public DateTime LastEnergyRecovery { get; set; } = DateTime.UtcNow;
    
    public TimeSpan TotalPlayTime { get; set; } = TimeSpan.Zero;
    
    public DateTime LastActiveAt { get; set; } = DateTime.UtcNow;
    
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
    
    public int Version { get; set; } = 1;
}
